#include <string.h>

#include "lib.h"

#include "vphand.h"

VPHand::VPHand(CardMgr* Mgr)
	: Hand(Mgr)
{
}

bool8
VPHand::replace(int32 index, uint8 card)
{
	if (index >= 0 && index < count)
	{
		cards[index] = card;
		return true;
	}
	return false;
}

void
VPHand::removeAt(int32 index)
{
	if (index >= 0 && index < count)
	{
		if (index < count - 1)
			memmove(cards + index, cards + index + 1, count - (index + 1));

		--count;
	}
}

void
VPHand::removeAll()
{
	count = 0;
}
